/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package properties;

import java.io.InputStream;
import java.io.IOException;
import java.util.Properties;
/**
 *
 * @author dspace
 */
public class LoadProperties {
    
    Properties properties = null;
    
    public LoadProperties(){
        properties = null;
        try {
             properties = new Properties();
             InputStream in = this.getClass().getClassLoader().getResourceAsStream("/properties/config.properties");
             properties.load(in);
         } catch (IOException ioe) {
        }
    }

    public String getRootPath(){
        String rootPath = properties.getProperty("root-path");
        if(!rootPath.endsWith("/")) rootPath = rootPath + "/";
        return rootPath;
    }
    public String getDatabaseName(){
        return properties.getProperty("db-name");
    }
    public String getDatabaseAgrovocName(){
        return properties.getProperty("db-name-agrovoc");
    }
    public String getDatabaseUser(){
        return properties.getProperty("db-user");
    }
    public String getDatabasePwd(){
        return properties.getProperty("db-pwd");
    }
    public String getDatabaseConnectionIP(){
        return properties.getProperty("db-ip");
    }
    public String getDatabaseConnectionPort(){
        return properties.getProperty("db-port");
    }
}
